<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script src="/xlive/script/xlv.js"></script>
</head>
<body>
	<div id="forumHeader_main" xlvobject="xlv.obj.pane" xlvprop="{forumKey:1}" style="font-family:'Arial';">
		    <div xlvobject="xlv.obj.webObject" xlvprop="{name:'forum.forum',globe:true,objectURL:'forum.forum',methodName:'forum'}"
			 	xlvmethod="{
				 	initial:function(){
				 		var forum_main=xlv.util.findParent(this,{id:'forum_main'});
				 		var forum_key=forum_main.$P.forumKey;
			 			this.$P.webObjectProperties={'forum':{'forum-key':forum_key}};
			 			this.$self('initial');
			 		}
			 	}"
		    >
		    </div>
			<table id="forum_head" style="width:800px;height:100px;background: url(/xlive/images/blueTexture.gif) left top repeat;border-collapse:collapse;font-family: Arial;font-size: 12px;text-align:left;">
				<tr>
					<td rowSpan="2" align="center" valign="middle"><div style="margin-left:16px" xlvobject="xlv.obj.img" xlvprop="{dmName:'forum.forum',dmPath:'forum.return.sql-statement.return.data.r.FORUM_ICON',width:80,height:80}"></div></td>
					<td width="100%" align="center">
						<div style="font-weight:bold;font-size:large;font-style:italic;margin-top:8px;margin-bottom:8px;color:white" id="forum_title" 
							 xlvobject="xlv.obj.viewer" 
							 xlvprop="{dmName:'forum.forum',dmPath:'forum.return.sql-statement.return.data.r.FORUM_TITLE'}">
						</div>
					</td>
					<td>
					</td>
				</tr>
				<tr>
					<td valign="top" align="center">
						<div xlvobject="xlv.obj.viewer" xlvprop="{dmName:'forum.forum',dmPath:'forum.return.sql-statement.return.data.r.FORUM_TEXT'}"
							xlvmethod="{
								mvc_valueToView:function(value){
									this.innerHTML=value;
								}
							}"
							>
						</div>
					</td>
					<td align="left" valign="bottom">
						  <nobr>
						  <span id="login" xlvobject="xlv.obj.dmProcess" 
						  		xlvprop="{dmName:'user',title:'login'}"
						  	    xlvmethod="{
						  	   		process:function(){
						  	   			this.getDesktop().showPane('/xlive/security/login.html',null,null,{invoker:this,align:'right'});
						  	   		},
			    					mvc_enableControl:function(dm){
										if(dm.getValue('login.return.valid')!='true') this.style.display='';
										else this.style.display='none';
			           				}
						  	   }"	
								
						  	><img src="/xlive/images/forum/user.png" width="24"></img>
						  </span>
						  <span xlvobject="xlv.obj.dmProcess" xlvprop="{dmName:'user',title:'logout'}" style="display:none"
						  	   xlvmethod="{
						  	   		process:function(){
						  	   			var user=this.getDataModel('user');
						  	   			user.logout();
						  	   		},
			    					mvc_enableControl:function(dm){
										if(dm.getValue('login.return.valid')=='true') this.style.display='';
										else this.style.display='none';
			           				}
						  	   }"	
						  	><img src="/xlive/images/forum/exit.png" width="24"></img>
						  </span>
						  <span id="register" xlvobject="xlv.obj.dmProcess" 
						  		xlvprop="{dmName:'user',title:'register'}"
						  	    xlvmethod="{
						  	   		process:function(){
						  	   			this.getDesktop().showPane('/xlive/security/register.html',null,null,{invoker:this,align:'right'});
						  	   		},
			    					mvc_enableControl:function(dm){
										if(dm.getValue('login.return.valid')!='true') this.style.display='';
										else this.style.display='none';
			           				}
						  	   }"	
								
						  	><img src="/xlive/images/forum/register.png" width="24"></img>
						  </span>
						  </nobr>
					</td>
				</tr>
				<tr>
					<td style="padding-left:12px;color:gray"><nobr>
						<div xlvobject="xlv.obj.viewer" xlvprop="{dmName:'user',dmPath:'login.return.valid'}"
							xlvmethod="{
								mvc_valueToView:function(value){
									var user_name=this.getObjectById('user_name');
									if('true'==value){
										var dm=this.getDataModel();
										xlv.util.setElementValue(user_name,dm.getValue('login.return.data.user-name'));
									}else {
										xlv.util.setElementValue(user_name,'anonymous')
									}
								}
							}"
							>
							<div>visitor : 
								<span id="user_name" style="color:black;font-weight:bold"></span>
							</div>
						</div>
						</nobr>
					</td>
					<td></td>
					<td>
						  <div>
						  	<nobr>
						  	<input id="query_text" type="text"></input>
						  	<span xlvobject="xlv.obj.process"
						  		 xlvmethod="{
						  		 	process:function(options){
						  		 		var qt = this.getObjectById('query_text').value.strip();
						  		 		if(qt=='') {
						  		 			alert('input query string');
						  		 			return;
						  		 		}
						  		 		var forum_key=xlv.util.findParent(this,{id:'forum_main'}).$P.forumKey;
						  		 		this.getBorderLayoutById('forum_main').setCenterPane('/xlive/forum/queryTopic.html',{caller:{'forum_key':forum_key,query_text:qt}},null,'bottom');
						  		 		
						  		 	}
						  		 }"
						  	>
						  		<img src="/xlive/images/forum/search.png" width="24"></img>
						  	</span>
						  	</nobr>
						  </div>
					</td>
				</tr>
			</table>
			
	</div>
</body>
</html>
